/* 添加全局样式，重置默认边距和滚动 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* 修改容器样式 */
.container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.form-container {
    max-width: 400px;
    width: 90%;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.form-container h2 {
    margin: 0 0 30px 0;
    color: #333;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 1px;
}

.form-container input {
    display: block;
    width: 100%;
    margin-bottom: 20px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    color: #333;
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.form-container input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-container button {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.form-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(0, 0, 0, 0.1);
}

.form-container button:active {
    transform: translateY(0);
}

.form-container button:last-child {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.form-container button:last-child:hover {
    background: #667eea;
    color: white;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 18px;
}

.input-group input {
    padding-left: 45px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-container {
    animation: fadeIn 0.5s ease-out;
}

.chat-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    height: 100%;
    width: 100%;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: #fff;
    margin: 0;
    overflow: hidden;
}

.chat-sidebar {
    width: 280px;
    border-right: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-sidebar h3 {
    padding: 15px;
    margin: 0;
    color: #333;
    font-size: 16px;
    /* border-bottom: 1px solid #e0e0e0; */
    background-color: #fff;
}

#onlineUsers {
    overflow-y: auto;
    flex: 1;
    height: calc(100vh - 50px);
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    position: relative;
    height: 100%;
    overflow: hidden;
    padding-bottom: 70px;
}

#messageArea {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f0f2f5;
    height: 100%;
    margin-top: 50px;
    /* margin-bottom: 20px; */
}

.chat-input {
    position: fixed;
    bottom: 0;
    left: 280px;
    right: 0;
    padding: 15px;
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    height: 70px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input input:focus {
    border-color: #4CAF50;
}

.chat-input button {
    padding: 8px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.chat-input button:hover {
    background-color: #45a049;
}

.online-user {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    background-color: #fff;
}

.online-user:hover {
    background-color: #f0f2f5;
}

.online-user .user-name {
    font-size: 14px;
    color: #333;
    flex: 1;
}

.online-user .online-status {
    color: #4CAF50;
    font-size: 12px;
    margin-left: 8px;
}

.error-message {
    color: #f44336;
    padding: 10px;
    text-align: center;
    font-size: 14px;
}

.no-users {
    color: #666;
    padding: 10px;
    text-align: center;
    font-size: 14px;
}

.chat-title {
    padding: 10px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
}

.message {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    margin-bottom: 15px;
    position: relative;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.sent {
    background-color: #dcf8c6;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.received {
    background-color: #fff;
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

.chat-header {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    z-index: 100;
    padding: 15px;
    background-color: #f0f2f5;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
}

.chat-header-title {
    font-size: 16px;
    color: #666;
    font-weight: 500;
    flex: 1;
    text-align: center;
}

.refresh-button {
    padding: 6px 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s ease;
    margin-left: auto;
}

.refresh-button:hover {
    background-color: #45a049;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 用户信息卡样式 */
.user-card {
    position: fixed;
    background: white;
    width: 300px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow: hidden;
    transform-origin: top left;
}

.user-card-header {
    background: #f8f9fa;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.user-card-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.user-card-content {
    padding: 20px;
    background: #fff;
}

.info-item {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    padding: 5px 0;
}

.info-label {
    color: #666;
    width: 70px;
    flex-shrink: 0;
    font-size: 14px;
}

.info-value {
    color: #333;
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

/* 美化关闭按钮 */
.close-card {
    width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-card:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
}

.message:last-child {
    margin-bottom: 30px;
}

/* 消息操作按钮样式 */
.message-actions {
    position: absolute;
    top: -20px;
    right: 0;
    display: none;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.message:hover .message-actions {
    display: block;
}

.delete-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    color: #f44336;
}

/* 已删除消息样式 */
.message.deleted {
    opacity: 0.5;
}

.message.deleted .message-content {
    font-style: italic;
    color: #999;
}

/* 调整操作按钮容器样式 */
.message-actions {
    display: flex;
    align-items: center;
}

/* 调整输入框图标 */
.input-group .fab.fa-qq {
    font-size: 20px;
}

.input-group .fas.fa-phone {
    font-size: 16px;
}

/* 可选字段的样式 */
.input-group input[placeholder*="选填"] {
    border-color: #ddd;
}

.input-group input[placeholder*="选填"]:focus {
    border-color: #667eea;
}

/* 侧边栏标题栏样式 */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fff;
}

.sidebar-header h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

/* 退出按钮样式 */
.logout-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #666;
    font-size: 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    color: #f44336;
    background-color: rgba(244, 67, 54, 0.1);
}
 